package com.songhq.kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;

public class Listener2 {
	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	@KafkaListener(topics = { "songhq" })
	public void listen(ConsumerRecord<?, ?> record) {
		logger.info("listener2 监听kafka的key: " + record.key());
		logger.info("listener2 监听kafka的value: " + record.value().toString());
	}
}